import service from "../utils/request";
import {queryKey} from '../utils'
 
// 业务模型
export function getBusinessModelList(params:any) {
  return service.get(`/business-models/tree`, { params });
}
export function createBusinessModelList(data:any) {
  return service.post(`/business-models`, data);
}
export function editBusinessModelList(id:number,data:any) {
  return service.put(`/business-models/${id}`,data);
}
export function deleteBusinessModelList(id:any) {
  return service.delete(`/business-models/${id}`);
}
// 集群
export function getClusterList(params:any) {
  const other = {resourceId:queryKey()?.resourceId,uuid:queryKey()?.clusterUuid}
  return service.get(`/cluster`, { params:{...params, ...other} });
}
export function editClusterList(id:number,data:any) {
  return service.put(`/cluster/${id}`,data);
}
export function getClusterDetail(id:any) {
  return service.get(`/cluster/${id}`);
}
export function syncCluster(data:any) {
  return service.post(`/cluster/sync`,data);
}
 // 绑定项目
export function clusterBindItpm(id:number,data:any) {
  return service.post(`/cluster/${id}/project`, data);
}
 // 标签
 export function getTagList(id:any) {
  return service.get(`/cluster/${id}/label`);
}
export function updataTagList(id:any,data:any) {
  return service.post(`/cluster/${id}/label`,data);
}